Repository navigation
Conversation
Signed-off-by: Бат-Орших <34618353+orshih6@users.noreply.github.com>
Merged
1 task
Author
|
Hi! Just checking in on this one. Is there anything you'd like changed, or anything else needed from my side? Happy to rework it, or to close it if it isn't a good fit. Thanks! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a request on an established HTTP/2 session is aborted, undici closes the stream and destroys it synchronously, so Node stops tracking the JS stream object. If the server's response HEADERS for that stream arrive afterwards, Node's
onSessionHeaderswraps the native stream in a newClientHttp2Streamand emits it on the session's'stream'event. undici had no'stream'listener, so this orphan stream had no'error'listener. When the idle timer later destroyed the session withInformationalError: socket idle timeout, Node passed that error to the orphan and it was thrown as an uncaught exception.The client session now listens for
'stream'. Push is disabled, so this event only fires for these orphans. The handler attaches the existing noop error sink and closes the stream withNGHTTP2_CANCEL. This targets the stream that actually emits the unhandled error, so it also covers other error-based session teardowns, not just the idle timeout.Testing:
test/issue-6143.jswith the reproduction from the issue. It failed in every run before the change and passes consistently after it.test/http2*.js,test/h2*.js,test/issue-5936.js,test/issue-5981.jsandtest/fetch/http2*.jspass.🤖 Generated with Claude Code
Fixes #6143
This change was prepared with an AI coding agent (Claude) and reviewed by me before submitting. I'm happy to make any changes you'd like.